<template>
  <el-container>
    <el-header>
      <div class="logo">
        <img src="../assets/heima.png" alt="">
        <span>电商后台管理系统</span>
      </div>
      <el-button type="info" @click="logout">退出</el-button>
    </el-header>
    <el-container>
      <el-aside width="200px">Aside</el-aside>
      <el-main>Main</el-main>
    </el-container>
  </el-container>
</template>

<script>
export default {
  data() {
    return {};
  },

  methods: {
    logout() {
      //点击退出 删除token值并跳转到登录页
      sessionStorage.removeItem("token");
      this.$router.push("/login");
    }
  },

  created() {}
};
</script>

<style lang='less' scoped>
.el-container {
  height: 100%;
  .el-header {
    display: flex;
    justify-content: space-between;
    background: #373d41;
    .logo {
      display: flex;
      align-items: center;
      span {
      font-size: 24px;
      color: #fff;
      margin-left: 10px;
    }
    }
  }
  .el-aside {
    background: #333744;
  }
  .el-main {
    background: #eaedf1;
  }
}
</style>
